<gm:page title="tagged blog feed" authenticate="true" onload="listAll()">

  <h1>tagged blog feed</h1>
  
  <gm:tabs target="cont"/>
  <gm:container id="cont">
    <gm:section id="rss" title="rss feed">
      <gm:list id="rawList" pageSize="10" template="t"/>
    </gm:section>
    <gm:section id="fav" title="favorite">
      <h3>Tags (<a href="#" onclick="listAll()">clear</a>)</h3>
      <gm:list id="labelList" data="${labels}" pageSize="10" template="l">
        <gm:handleEvent event="select" execute="listTag(event.entry);"/>
      </gm:list>
      <gm:list id="annotatedList" pageSize="10" sort="rating" template="t">
        <gm:sort ref="gd:entryLink/entry/gd:rating/@value" name="rating" reverse="true"/>
      </gm:list>
    </gm:section>
  </gm:container>      <gm:template id="t">
    <table style="width: 100%" class="blue-theme">
      <tr repeat="true">
        <td><gm:text ref="atom:title"/></td>
        <td><gm:rating ref="gd:entryLink/entry/gd:rating"/></td>
        <td><gm:labels/></td>
      </tr>
      <tr>
        <td colspan="3"><gm:pager/></td>
      </tr>
    </table>
  </gm:template>
  <gm:template id="l">
    <ul>
      <li repeat="true"><gm:text ref="atom:title"/></li>
    </ul>
  </gm:template>
  <script language="JavaScript">
  var feed = 'http://feeds.feedburner.com/boingboing/iBag';  function listTag(entry) {
    var categoryGpath = new GPath('category/@term');
    var term = categoryGpath.getValue(entry);
    var list = google.mashups.getObjectById('annotatedList');
    var newData = feed + '|${annotations}:(' + term + ')';
    list.setData(newData);
  }
  function listAll() {
    var list = google.mashups.getObjectById('annotatedList');
    var newData = feed + '|${annotations}';
    list.setData(newData);
    list = google.mashups.getObjectById('rawList');
    list.setData(newData);
  }
  </script>

</gm:page